package com.xxx.video.dynamic.activitys;

import android.os.Bundle;
import android.widget.TextView;

import com.xxx.video.R;
import com.xxx.video.commen.activitys.BaseActivity;
import com.xxx.video.commen.utils.StatusBarUtil;
import com.xxx.video.dynamic.presenters.IMessageDetailsView;
import com.xxx.video.dynamic.presenters.MessageDetailsPresenter;
import com.xxx.video.main.beans.SystemMessageDetailsBean;

import butterknife.BindView;

public class MessageDetailsActivity extends BaseActivity<MessageDetailsPresenter> implements IMessageDetailsView {

    @BindView(R.id.tv_message_details)
    TextView tvMessageDetails;
    /**
     * message Id
     */
    private String mId;
    @Override
    public void initToolbarData() {
        super.initToolbarData();
        showActionBar();
        StatusBarUtil.getInstance().setStatusBarTransparent(this, true);
        setIsShowActionbarLine(true);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_message_details;
    }

    @Override
    protected MessageDetailsPresenter createPresenter() {
        return new MessageDetailsPresenter(this, this);
    }

    @Override
    public void initData(Bundle extras) {
        if (extras != null) {
            mId = extras.getString("Id");
        }
        getPresenter().getMessageDetails(mId);
    }

    @Override
    public void showRootLayoutStatus(int status) {
        showLayoutStatus(status);
    }

    @Override
    public void initData2View(SystemMessageDetailsBean successOb) {
        showLayoutStatus(1);
        tvMessageDetails.setText(successOb.info.fContent);
    }
}
